import request from '@/utils/request'

// 查询运单挂账列表
export function listAccount(query) {
  return request({
    url: '/waybills/waybill/list',
    method: 'get',
    params: query
  })
}

// 查询运单挂账详细
export function getAccount(wayBillId) {
  return request({
    url: '/waybills/waybill/' + wayBillId,
    method: 'get'
  })
}

// 新增运单挂账
export function addAccount(data) {
  return request({
    url: '/waybills/waybill',
    method: 'post',
    data: data
  })
}

// 修改运单挂账
export function updateAccount(data) {
  return request({
    url: '/waybills/waybill',
    method: 'put',
    data: data
  })
}

// 删除运单挂账
export function delAccount(wayBillId) {
  return request({
    url: '/waybills/waybill/account/' + wayBillId,
    method: 'delete'
  })
}

// 查询运单挂账列表
export function listAccountExt(query) {
  return request({
    url: '/waybills/waybill/list/ext',
    method: 'get',
    params: query
  })
}

// 运单挂账
export function account(data) {
  return request({
    url: '/waybills/waybill/account',
    method: 'put',
    data: data
  })
}

// 运单结算
export function settlement(data) {
  return request({
    url: '/waybills/waybill/settlement',
    method: 'put',
    data: data
  })
}
